import httpRequest from '@/utils/httpRequest'
import Vue from "vue";

export function getOssList (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/oss/list'),
    method: 'get',
    params: httpRequest.adornParams(data)
  })
}

export function deleteOss (ids, openDefultdata = true) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/oss/delete'),
    method: 'post',
    data: httpRequest.adornData(ids, openDefultdata)
  })
}

export function getOssConfig (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/oss/config'),
    method: 'get',
    params: httpRequest.adornParams(data)
  })
}

export function ossConfigSave (data) {
  return httpRequest({
    url: httpRequest.adornUrl(`/sys/oss/saveConfig`),
    method: 'post',
    data: httpRequest.adornData(data)
  })
}

export function getUploadUrl () {
  return httpRequest.adornUrl(`/sys/oss/upload?token=${Vue.cookie.get('token')}`)
}
